﻿/* 
 *  <copyright file="GamepadDevice.cs" company="Wesley Jowitt">
 *  
 *  SobrietyEngine: Copyright (c) 2011 Wesley Jowitt
 *  
 *  This software is distributed under a software license.
 *   * As of the creation time of this file, the license in use is the Microsoft Permissive License (Ms-PL) 
 *    * The license can be viewed at:
 *     * License.Txt in the root folder of this project
 *      * http://sobrietyengine.codeplex.com/license
 *       * http://www.microsoft.com/opensource/licenses.mspx
 *       
 *  </copyright>
 *   */

using System.Collections.Generic;

namespace SobrietyEngine.PathFinding
{
    public class Graph
    {
        public List<INode> Nodes { get; private set; }
        public List<IEdge> Edges { get; private set; }

        public Graph()
        {
            Nodes = new List<INode>();
            Edges = new List<IEdge>();
        }

        public void AddNode(INode node)
        {
            Nodes.Add(node);
        }

        public void AddEdge(IEdge edge)
        {
            Edges.Add(edge);
        }

        public void CreateBiEdge(INode n1, INode n2)
        {
            Edges.Add(new Edge(n1, n2, false));
        }

        public void CreateUniEdge(INode n1, INode n2)
        {
            Edges.Add(new Edge(n1, n2, true));
        }

        public void Clear()
        {
            Nodes.Clear();
            Edges.Clear();
        }
    }
}
